<?php

namespace App\Http\Controllers\Api;

use App\Http\Controllers\Controller;
use App\Http\Resources\UserCollection;
use App\Http\Resources\UserResource;
use Illuminate\Http\Request;
use Jiannei\Response\Laravel\Support\Facades\Response;
use App\Models\User;
use App\Repositories\Enum\ResponseCodeEnum;

class IndexController extends Controller
{
    public function index()
    {
        $users = User::all();
        return Response::success(new UserCollection($users));
    }

    public function show($id)
    {
        $user = User::find($id);
        return Response::success(new UserResource($user), '查询成功', ResponseCodeEnum::SERVICE_QUERY_SUCCESS);
    }

    public function store(Request $request)
    {

    }

    public function update($id, Request $request)
    {

    }

    public function destroy($id)
    {

    }
}
